package duojiekou;

public class Test {
    public static void fuc(Animal animal){
        animal.eat();
    }
    public static void run(IRuning iRuning){
        iRuning.run();//接口作为参数进行接收
    }
    public static void swim(ISwiming iSwiming){
        iSwiming.swim();
    }

    public static void main(String[] args) {
        run(new Dog("小胡",12));
        swim(new Dog("小胡",28));
    }
    public static void main1(String[] args) {
        fuc(new Dog("小王",21));
    }
}
